/*
 * @Description: 追源码-模块路由
 * @Author: xinqiao lxq1990.0716@qq.com
 * @Date: 2025-02-11
 * @LastEditors: xinqiao lxq1990.0716@qq.com
 * @LastEditTime: 2025-02-12
 */

export default [
  // 溯源码首页
  {
    path: '/source',
    name: 'source',
    component: () => import('/@/layouts/layoutMenu.vue'),
    redirect: '/source/index',
    children: [
      {
        path: 'index',
        name: 'source-index',
        component: () => import('/@/views/main/code/index/index.vue'),
      },
    ],
  },
  // 报告管理
  {
    path: '/report',
    name: 'report',
    component: () => import('/@/layouts/layoutMenu.vue'),
    redirect: '/report/viewReport',
    children: [
      // 查看报告
      {
        path: 'viewReport',
        name: 'report-list',
        component: () => import('/@/views/main/code/report/list.vue'),
      },
      {
        path: 'detailReport',
        name: 'report-detail',
        component: () => import('/@/views/main/code/report/detail.vue'),
      },
      // 扫码上传
      {
        path: 'uploadReport',
        name: 'report-scan',
        component: () => import('/@/views/main/code/report/scan.vue'),
      },
    ],
  },
  // 渠道管理
  {
    path: '/channel',
    name: 'channel',
    component: () => import('/@/layouts/layoutMenu.vue'),
    children: [
      // 渠道管理
      {
        path: 'channelManage',
        name: 'channel-manage',
        redirect: '/channel/channelManage/list',
        children: [
          {
            path: 'list',
            name: 'channel-manage-list',
            component: () => import('/@/views/main/channel/channelManage/list.vue'),
          },
          {
            path: 'add',
            name: 'channel-manage-add',
            component: () => import('/@/views/main/channel/channelManage/add.vue'),
          },
        ],
      },
      // 查看码
      {
        path: 'viewCode',
        name: 'view-code',
        component: () => import('/@/views/main/channel/viewCode/list.vue'),
      },
    ],
  },
  // 码管理
  {
    path: '/code',
    name: 'code',
    component: () => import('/@/layouts/layoutMenu.vue'),
    children: [
      {
        path: 'index',
        name: 'code-index',
        component: () => import('/@/views/main/code/index/index.vue'),
      },
      // 批次管理
      {
        path: 'batchManage',
        name: 'batch-manage',
        redirect: '/code/batchManage/list',
        children: [
          {
            path: 'list',
            name: 'code-batchManage-list',
            component: () => import('/@/views/main/code/batch/list.vue'),
          },
          {
            path: 'add',
            name: 'code-batchManage-add',
            component: () => import('/@/views/main/code/batch/add.vue'),
          },
          {
            path: 'detail',
            name: 'code-batchManage-detail',
            component: () => import('/@/views/main/code/batch/detail.vue'),
          },
        ],
      },
      // 商品管理
      {
        path: 'productManage',
        name: 'product-manage',
        redirect: '/code/productManage/list',
        children: [
          {
            path: 'list',
            name: 'code-productManage-list',
            component: () => import('/@/views/main/code/product/list.vue'),
          },
          {
            path: 'edit',
            name: 'code-productManage-edit',
            component: () => import('/@/views/main/code/product/edit.vue'),
          },
        ],
      },
    ],
  },
  // 问卷管理（cms）
  {
    path: '/paper',
    name: 'paper',
    component: () => import('/@/layouts/layoutMenu.vue'),
    children: [
      // 问卷管理
      {
        path: 'paper',
        name: 'paper-paper',
        component: () => import('/@/views/subModule/index.vue'),
      },
    ],
  },
]
